package mapper;

import java.util.HashMap;
import java.util.Map;

/**
 * Context 用于封装每个应用下web.xml配置servlet信息
 */
public class Context {

    private String contextName;
    private Map<String, Wrapper> wrapperMap = new HashMap<>();

    public void setContextName(String contextName) {
        this.contextName = contextName;
    }

    public String getContextName() {
        return this.contextName;
    }

    public void addWrapper(Wrapper wapper) {
        wrapperMap.put(wapper.getUrlPattern(),wapper);
    }

    public Wrapper findWrapper(String urlPattern) {
        return wrapperMap.get(urlPattern);
    }

}
